package com.ms3ds.mineInfo.api;

import com.ms3ds.common.core.constant.ServiceNameConstants;
import com.ms3ds.common.core.domain.R;
import com.ms3ds.mineInfo.api.domain.Task;
import com.ms3ds.mineInfo.api.domain.Worker;
import com.ms3ds.mineInfo.api.factory.RemoteTaskFallbackFactory;
import com.ms3ds.mineInfo.api.factory.RemoteWorkerFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 矿山信息服务
 * 
 * @author zlw
 */
@FeignClient(contextId = "remoteTaskService", value = ServiceNameConstants.MINEINFO_SERVICE, fallbackFactory = RemoteTaskFallbackFactory.class)
public interface RemoteTaskService
{

    /**
     * 获取矿山下的生产队信息
     * @return
     */
    @GetMapping("/task/getTaskByTeamIdForRemote")
    public R<List<Task>> getTaskByTeamIdForRemote(@RequestParam("teamId") Long teamId);

    @PutMapping("/task/editTaskForRemote")
    public R<Boolean> editTaskForRemote(@RequestBody Task task);

    @GetMapping("/task/generateMonthTask")
    public R<Boolean> generateMonthTask();

    @GetMapping("/task/getYearTaskByTeamIdForRemote")
    public R<Task> getYearTaskByTeamIdForRemote(@RequestParam("teamId") Long teamId);
}
